package com.lvmama.rhino.pojo;

import java.util.List;

/**
 * Created by wxxuyuan on 2017/2/27.
 */
public class BasePageInfoVO<T> {
    private List<T> data;

    private Integer pageSize = 10;//默认每页10条

    private Integer pageNow;//用户指定

    private Integer rowCount;//数据库查出

    private Integer pageCount;//通过rowCount、pageSize计算出

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Integer getPageCount() {
        return rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNow() {
        return pageNow;
    }

    public void setPageNow(Integer pageNow) {
        this.pageNow = pageNow;
    }

    public Integer getRowCount() {
        return rowCount;
    }

    public void setRowCount(Integer rowCount) {
        this.rowCount = rowCount;
    }

    @Override
    public String toString() {
        return "BasePageInfoVO{" +
                "data=" + data +
                ", pageSize=" + pageSize +
                ", pageNow=" + pageNow +
                ", rowCount=" + rowCount +
                ", pageCount=" + pageCount +
                '}';
    }
}
